<template>
   <van-nav-bar 
        :title="title" 
        fixed
        class="myhead"
    >   
        <template #left v-if="back" >
            <slot >
                <van-icon name="arrow-left" class="size" @click="gotoback" />
            </slot>
        </template>
    </van-nav-bar>
</template>

<script>
export default {
    data() {
        return {

        }
    },
props:{
        title:String,
        back:{
            type:Boolean,
            default:true,
        } 
    },
    methods: {
    },
}
</script>

<style>
.myhead{
    width:100%;
    position: fixed;
    top:0;
    left:0;
    z-index:2;
}
.size{
    font-size: 20px;
    }
</style>